const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  mode: 'development',
  entry: {
    index: './src/index.js',
    mock: './test/mock.js',
    test: './test/test.js',
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'CRUD-Vue',
      template: path.join(__dirname, 'public/index.html'),
    }),
  ],
  devServer: {
    host: 'localhost',
    open: true,
    watchFiles: ['src/**/*', 'mock/**/*'],
    compress: true,
    port: 9000,
    hot: true,
  },
};
